<template>
	<view class="wrap">
		<u-navbar title="基金" :background="background" back-icon-color="#fff" back-icon-size="36" title-color="#fff"
			title-size="34" :border-bottom="false">
			<view slot="right" class="slot-right">
				<button type="default" class="btn">
					<u-icon name="search" size="36" color="#fff"></u-icon>
				</button>
				<button type="default" class="btn">
					<u-icon name="plus-circle" size="36" color="#fff"></u-icon>
				</button>
			</view>
		</u-navbar>
		<view class="fund">
			<view class="fund__hd flex-center">
				<view class="fund-group flex-center flex_bd">
					<view class="fund-item flex_bd">
						<view class="name">
							上证指数
						</view>
						<view class="flex-center">
							<view class="price">3655.911</view>
							<view class="chg">-0.18%</view>
						</view>
					</view>
					<view class="fund-item flex_bd">
						<view class="name">
							深证成指
						</view>
						<view class="flex-center">
							<view class="price">14562.461</view>
							<view class="chg">-0.44%</view>
						</view>
					</view>
					<view class="">
						<u-icon name="arrow-down" size="28" color="#cbcbcb"></u-icon>
					</view>
				</view>
				<view class="arrow-right flex-center">
					<text>投票自选</text>
					<u-icon name="arrow-right" size="24" color="#4968d6"></u-icon>
				</view>
			</view>
			<view class="fund__bd flex-center">
				<view class="fund__ac flex-center flex_bd">
					<image src="../../static/uview/images/fund-icon1.png" class="icon" mode=""></image>
					<view class="title">
						基金对比
					</view>
				</view>
				<view class="fund__ac flex-center flex_bd">
					<image src="../../static/uview/images/fund-icon2.png" class="icon" mode=""></image>
					<view class="title">
						基金编辑
					</view>
				</view>
			</view>
		</view>
		<view class="content">
			<view class="panel">
				<view class="panel-body">
					<view class="scroll-warp">
						<scroll-view class="scroll-view_H" scroll-x="true">
							<view class="scroll-view-item_H">
								<view class="scroll-view-head">
									<view class="title">本周销量TOP</view>
									<view class="desc">近一周最热销的金选基金</view>
								</view>
								<view class="scroll-view-body">
									<u-checkbox-group @change="checkboxGroupChange">
										<view class="scroll-list flex" v-for="(item,index) in product" :key="index">
											<view class="scroll-list__hd">
												<u-checkbox @change="checkboxChange" v-model="item.checked"
													shape="circle" size="42"></u-checkbox>
											</view>
											<view class="scroll-list__bd">
												<view class="val">+<text>{{item.val}}</text>%</view>
												<view class="chg">近1年涨跌幅</view>
											</view>
											<view class="scroll-list__ft flex_bd">
												<view class="name">{{item.name}}</view>
												<view class="people">近1周购买超{{item.people}}万人</view>
											</view>
										</view>
									</u-checkbox-group>
								</view>
								<view class="scroll-view-footer">
									<button type="default" class="btn">一键添加自选</button>
								</view>
							</view>
							<view class="scroll-view-item_H">
								<view class="scroll-view-head">
									<view class="title">土豪都爱TOP</view>
									<view class="desc">近一周土豪的金选基金</view>
								</view>
								<view class="scroll-view-body">
									<u-checkbox-group @change="checkboxGroupChange">
										<view class="scroll-list flex" v-for="(item,index) in product" :key="index">
											<view class="scroll-list__hd">
												<u-checkbox @change="checkboxChange" v-model="item.checked"
													shape="circle" size="42"></u-checkbox>
											</view>
											<view class="scroll-list__bd">
												<view class="val">+<text>{{item.val}}</text>%</view>
												<view class="chg">近1年涨跌幅</view>
											</view>
											<view class="scroll-list__ft flex_bd">
												<view class="name">{{item.name}}</view>
												<view class="people">近1周购买超{{item.people}}万人</view>
											</view>
										</view>
									</u-checkbox-group>
								</view>
								<view class="scroll-view-footer">
									<button type="default" class="btn">一键添加自选</button>
								</view>
							</view>
						</scroll-view>
					</view>
				</view>
				<view class="panel-footer flex-center">
					<view class="flex_bd">
						<view class="btn-box">
							<image src="../../static/uview/images/name1.png" class="icon" mode=""></image>
							<view class="title">识图批量导入</view>
						</view>
					</view>
					<view class="flex_bd">
						<view class="btn-box">
							<image src="../../static/uview/images/name1.png" class="icon" mode=""></image>
							<view class="title">搜索加自选</view>
						</view>
					</view>
				</view>
			</view>
			<u-divider color="#999" half-width="190" border-color="#e9e9e9" bg-color="">找到更多优质基金</u-divider>
			<view class="f-grid">
				<u-grid :col="3" :border="false">
					<u-grid-item bg-color="transparent" v-for="(item,index) in grid" :key="index">
						<image :src="item.img" class="icon" mode=""></image>
						<view class="grid-text">{{item.title}}</view>
					</u-grid-item>
				</u-grid>
			</view>

		</view>
		<u-tabbar v-model="current" inactive-color="#868686" active-color="#3270f5" :list="list"></u-tabbar>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [{
					iconPath: "../../static/uview/images/j1.png",
					selectedIconPath: "../../static/uview/images/j1_on.png",
					text: '市场',
					pagePath: '/pages/fund/index',
				}, {
					iconPath: "../../static/uview/images/j3.png",
					selectedIconPath: "../../static/uview/images/j3_on.png",
					text: '自选',
					pagePath: '/pages/fund/optional',
				}, {
					iconPath: "../../static/uview/images/j2.png",
					selectedIconPath: "../../static/uview/images/j2_on.png",
					text: '持有',
					pagePath: '/pages/fund/hold',
				}, ],
				current: 0,
				background: {
					backgroundColor: '#3476fe'
				},
				grid: [{
					img: '../../static/uview/images/f-grid1.png',
					title: '金选好基'
				}, {
					img: '../../static/uview/images/f-grid2.png',
					title: '金牌经理专场'
				}, {
					img: '../../static/uview/images/f-grid3.png',
					title: '指数专区'
				}],
				product: [{
					checked: true,
					val: '24.22',
					name: '中欧医疗健康混合C',
					people: 30
				}, {
					checked: true,
					val: '15.51',
					name: '天弘永利债券B',
					people: 20
				}, {
					checked: true,
					val: '+4.57%',
					name: '景顺长城新兴成长',
					people: 10
				}]
			}
		},
		computed: {},
		onShow() {},
		methods: {
			// 选中某个复选框时，由checkbox时触发
			checkboxChange(e) {
				//console.log(e);
			},
			// 选中任一checkbox时，由checkbox-group触发
			checkboxGroupChange(e) {
				// console.log(e);
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f6f6f6;
	}

	.slot-right {
		padding-right: 30rpx;

		.btn {
			display: inline-block;
			background-color: transparent;
			height: 64rpx;
			padding: 0;
			line-height: 1.8;
			margin-left: 30rpx;
			vertical-align: middle;
		}
	}


	.fund {
		background-color: #fff;

		.fund__hd {
			padding: 30rpx;
			border-bottom: 1rpx solid #f4f4f4;

			.fund-item {
				.name {
					font-size: 28rpx;
					color: #232323;
					margin-bottom: 6rpx;
				}

				.price {
					font-size: 24rpx;
					color: #449189;
					margin-right: 20rpx;
				}

				.chg {
					font-size: 18rpx;
					line-height: 24rpx;
					padding: 0 8rpx;
					background-color: #e5f6f3;
					color: #449189;
				}
			}

			.arrow-right {
				margin-left: 16rpx;
				justify-content: center;
				width: 136rpx;
				height: 58rpx;
				font-size: 24rpx;
				color: #4968d6;
				border: 2rpx solid #98aac6;
				background-color: #f6f9ff;
			}
		}

		.fund__bd {
			.fund__ac {
				justify-content: center;
				padding: 32rpx;

				.icon {
					width: 32rpx;
					height: 32rpx;
					display: block;
					margin-right: 12rpx;
				}

				.title {
					font-size: 26rpx;
					color: #8c8c8c;
				}
			}
		}
	}

	.content {
		padding: 20rpx 30rpx;
		position: relative;
	}

	.f-grid {
		.icon {
			width: 50rpx;
			height: 50rpx;
			display: block;
		}

		.grid-text {
			font-size: 24rpx;
			color: #9b9b9e;
			margin-top: 4rpx;
		}
	}

	.panel {
		background-color: #fff;
		border-radius: 10rpx;
		margin-bottom: 40rpx;

		.panel-body {
			padding: 20rpx;
		}

		.panel-footer {
			border-top: 1rpx solid #f8f8f8;
		}
	}

	.btn-box {
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 26rpx;
		color: #0f0f0f;
		padding: 24rpx;

		.icon {
			width: 32rpx;
			height: 32rpx;
			display: block;
			margin-right: 16rpx;
		}
	}

	.scroll-warp {
		margin-right: -20rpx;
	}

	.scroll-view_H {
		height: 614rpx;
		white-space: nowrap;

		.scroll-view-item_H {
			width: 526rpx;
			margin-right: 10rpx;
			padding: 20rpx;
			height: 100%;
			background-color: #fff7f5;
			display: inline-block;

			.scroll-view-head {
				border-bottom: 1rpx solid #e6d6d7;
				padding-bottom: 24rpx;

				.title {
					font-size: 34rpx;
					color: #f2614d;
					margin-bottom: 8rpx;
				}

				.desc {
					color: #f2614d;
					font-size: 24rpx;
					opacity: 0.6;
				}
			}

			.scroll-view-footer {
				.btn {
					height: 94rpx;
					color: #fff;
					background-color: #3476fe;
					font-size: 34rpx;
				}
			}
		}
	}

	.scroll-view-body {
		padding-top: 20rpx;
	}

	.scroll-list {
		padding: 20rpx 0;
	}

	.scroll-list__hd {
		width: 74rpx;
		padding-top: 10rpx;
	}

	.scroll-list__bd {
		width: 184rpx;

		.val {
			font-size: 24rpx;
			color: #cb4c22;
			margin-bottom: 6rpx;

			text {
				font-size: 28rpx;
			}
		}

		.chg {
			font-size: 24rpx;
			color: #938d8a;
		}
	}

	.scroll-list__ft {
		.name {
			font-size: 24rpx;
			color: #26211e;
			margin-bottom: 10rpx;
		}

		.people {
			font-size: 24rpx;
			color: #b3aeab;
		}
	}

	.u-checkbox-group {
		display: block;
	}
</style>
